<template>
  <div>
    <!-- 用户中心首页 2018/2/20 20:56 zhangQ -->
    <Tabs v-model="currentName">
      <TabPane label="基本信息" name="1">
      </TabPane>
      <TabPane label="修改信息" name="2">
      </TabPane>
      <TabPane label="修改密码" name="3">
      </TabPane>
    </Tabs>
    <!--基本信息-->
    <Card v-if="currentName=='1'">
      <defaultInfo></defaultInfo>
    </Card>
    <!--修改信息-->
    <Card v-if="currentName=='2'">
      <changeInfo></changeInfo>
    </Card>
    <!--修改密码-->
    <Card v-if="currentName=='3'">
      <changePWD></changePWD>
    </Card>
  </div>
</template>
<script>
  import defaultInfo from './components/defaultInfo.vue'
  import changePWD from './components/changePWD.vue'
  import changeInfo from './components/changeInfo.vue'

  export default {
    name: 'index',
    data () {
      let currentName = '1'
      let datas = {currentName}
      return datas
    },
    methods: {
      /**
       * 点击Tabs切换
       * @param val
       */
      tabClick (val) {
        if (!val) {
          val = this.currentName
        } else {
          this.currentName = val
        }
      }
    },
    components: {defaultInfo, changePWD, changeInfo}
  }
</script>

